package com.bgt.utils;

import java.util.Date;
import java.util.List;

import org.apache.commons.beanutils.DynaBean;
import org.apache.commons.beanutils.DynaProperty;

public class Bean {

	private DynaBean dynaBean;
	private List<DynaProperty> dynaBeanProperties;

	public Bean(DynaBean dyanBean, List<DynaProperty> dynaBeanProperties)
			throws Exception {

		this.dynaBean = dyanBean;
		this.dynaBeanProperties = dynaBeanProperties;
	}

	public void setString(String name, String property) {
		dynaBean.set(name, property);
	}

	public void setInteger(String name, Integer property) {
		dynaBean.set(name, property);
	}

	public void setFloat(String name, Float property) {
		dynaBean.set(name, property);
	}

	public void setBoolean(String name, Boolean property) {
		dynaBean.set(name, property);
	}

	public void setDate(String name, Date property) {
		dynaBean.set(name, property);
	}

	public void setLong(String name, Long property) {
		dynaBean.set(name, property);
	}

	public void setList(String name, List<Bean> property) {
		dynaBean.set(name, property);
	}

	public void setObject(String name, Object property) {
		dynaBean.set(name, property);
	}

	public Object get(String name) {
		return dynaBean.get(name);
	}

	public Object get(String name, int idx) {
		return dynaBean.get(name, idx);
	}

	public Object get(String name, String s) {
		return dynaBean.get(name, s);
	}

	public DynaBean getEntity() {
		return this.dynaBean;
	}

	public List<DynaProperty> getProperties() {
		return this.dynaBeanProperties;
	}
}
